package com.softoa.contorller;

import com.softoa.pojo.Task;
import com.softoa.pojo.Taskuser;
import com.softoa.pojo.User;
import com.softoa.service.ITaskService;
import com.softoa.service.ITaskUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/task")
@CrossOrigin
public class TaskController {
    @Autowired
    ITaskService taskService;


    @RequestMapping("taskshow")
    public List<Task> tasksShow(Task task){
        return taskService.taskSelectList(task);
    }

    @RequestMapping("taskcreat")
    public long taskCreat(Task task){
        taskService.taskInsert(task);
        Task task1=taskService.taskSelectOne(task);
        return task1.getTaskId();
    }

    @RequestMapping("taskupdate")
    public int taskUpdate(Task task){
        taskService.taskUpdate(task);
        return 1;
    }
}
